package com.forum.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 评论
 * @TableName forum_comment
 */
@TableName(value ="forum_comment")
public class ForumComment implements Serializable {
    /**
     * 评论ID
     */
    @TableId(type = IdType.AUTO)
    private Integer commentId;

    /**
     * 父级评论ID
     */
    private Integer pCommentId;

    /**
     * 文章ID
     */
    private String articleId;

    /**
     * 回复内容
     */
    private String content;

    /**
     * 图片
     */
    private String imgPath;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 被回复人ID
     */
    private Long replyUserId;

    /**
     * 被回复人昵称
     */
    private String replyNickName;

    /**
     * 0:未置顶  1:置顶
     */
    private Integer topType;

    /**
     * 发布时间
     */
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date postTime;

    /**
     * good数量
     */
    private Integer goodCount;

    /**
     * 0:待审核  1:已审核
     */
    private Integer status;

    /**
     * 
     */
    @TableLogic
    @TableField(select = false)
    private Integer deleteFlag;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    public Integer getCommentId() {
        return commentId;
    }

    /**
     * 评论ID
     */
    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    /**
     * 父级评论ID
     */
    public Integer getpCommentId() {
        return pCommentId;
    }

    /**
     * 父级评论ID
     */
    public void setpCommentId(Integer pCommentId) {
        this.pCommentId = pCommentId;
    }

    /**
     * 文章ID
     */
    public String getArticleId() {
        return articleId;
    }

    /**
     * 文章ID
     */
    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    /**
     * 回复内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 回复内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 图片
     */
    public String getImgPath() {
        return imgPath;
    }

    /**
     * 图片
     */
    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    /**
     * 用户ID
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * 用户ID
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * 昵称
     */
    public String getNickName() {
        return nickName;
    }

    /**
     * 昵称
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 被回复人ID
     */
    public Long getReplyUserId() {
        return replyUserId;
    }

    /**
     * 被回复人ID
     */
    public void setReplyUserId(Long replyUserId) {
        this.replyUserId = replyUserId;
    }

    /**
     * 被回复人昵称
     */
    public String getReplyNickName() {
        return replyNickName;
    }

    /**
     * 被回复人昵称
     */
    public void setReplyNickName(String replyNickName) {
        this.replyNickName = replyNickName;
    }

    /**
     * 0:未置顶  1:置顶
     */
    public Integer getTopType() {
        return topType;
    }

    /**
     * 0:未置顶  1:置顶
     */
    public void setTopType(Integer topType) {
        this.topType = topType;
    }

    /**
     * 发布时间
     */
    public Date getPostTime() {
        return postTime;
    }

    /**
     * 发布时间
     */
    public void setPostTime(Date postTime) {
        this.postTime = postTime;
    }

    /**
     * good数量
     */
    public Integer getGoodCount() {
        return goodCount;
    }

    /**
     * good数量
     */
    public void setGoodCount(Integer goodCount) {
        this.goodCount = goodCount;
    }

    /**
     * 0:待审核  1:已审核
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 0:待审核  1:已审核
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 
     */
    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    /**
     * 
     */
    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ForumComment other = (ForumComment) that;
        return (this.getCommentId() == null ? other.getCommentId() == null : this.getCommentId().equals(other.getCommentId()))
            && (this.getpCommentId() == null ? other.getpCommentId() == null : this.getpCommentId().equals(other.getpCommentId()))
            && (this.getArticleId() == null ? other.getArticleId() == null : this.getArticleId().equals(other.getArticleId()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getImgPath() == null ? other.getImgPath() == null : this.getImgPath().equals(other.getImgPath()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getNickName() == null ? other.getNickName() == null : this.getNickName().equals(other.getNickName()))
            && (this.getReplyUserId() == null ? other.getReplyUserId() == null : this.getReplyUserId().equals(other.getReplyUserId()))
            && (this.getReplyNickName() == null ? other.getReplyNickName() == null : this.getReplyNickName().equals(other.getReplyNickName()))
            && (this.getTopType() == null ? other.getTopType() == null : this.getTopType().equals(other.getTopType()))
            && (this.getPostTime() == null ? other.getPostTime() == null : this.getPostTime().equals(other.getPostTime()))
            && (this.getGoodCount() == null ? other.getGoodCount() == null : this.getGoodCount().equals(other.getGoodCount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getDeleteFlag() == null ? other.getDeleteFlag() == null : this.getDeleteFlag().equals(other.getDeleteFlag()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCommentId() == null) ? 0 : getCommentId().hashCode());
        result = prime * result + ((getpCommentId() == null) ? 0 : getpCommentId().hashCode());
        result = prime * result + ((getArticleId() == null) ? 0 : getArticleId().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getImgPath() == null) ? 0 : getImgPath().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getNickName() == null) ? 0 : getNickName().hashCode());
        result = prime * result + ((getReplyUserId() == null) ? 0 : getReplyUserId().hashCode());
        result = prime * result + ((getReplyNickName() == null) ? 0 : getReplyNickName().hashCode());
        result = prime * result + ((getTopType() == null) ? 0 : getTopType().hashCode());
        result = prime * result + ((getPostTime() == null) ? 0 : getPostTime().hashCode());
        result = prime * result + ((getGoodCount() == null) ? 0 : getGoodCount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getDeleteFlag() == null) ? 0 : getDeleteFlag().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", commentId=").append(commentId);
        sb.append(", pCommentId=").append(pCommentId);
        sb.append(", articleId=").append(articleId);
        sb.append(", content=").append(content);
        sb.append(", imgPath=").append(imgPath);
        sb.append(", userId=").append(userId);
        sb.append(", nickName=").append(nickName);
        sb.append(", replyUserId=").append(replyUserId);
        sb.append(", replyNickName=").append(replyNickName);
        sb.append(", topType=").append(topType);
        sb.append(", postTime=").append(postTime);
        sb.append(", goodCount=").append(goodCount);
        sb.append(", status=").append(status);
        sb.append(", deleteFlag=").append(deleteFlag);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}